package utils;

import com.alibaba.fastjson.JSONObject;
import com.dh.UserServerApplication;
import com.dh.core.Exception.ExceptionEnum;
import com.dh.core.common.Results;
import com.dh.manager.util.JWTUtils;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.Date;

@SpringBootTest(classes = {UserServerApplication.class})
public class common {
    @Resource
    private JWTUtils jwtUtils;
    @Test
    public void test() {
        long l = System.currentTimeMillis();
        System.out.println(new Date(l));
        System.out.println(l);
        System.out.println(new Date(l+24*60*60*1000));
    }
    @Test
    public void test2() {
        String o= JSONObject.toJSONString(Results.fail(ExceptionEnum.JwtCheckException));
        System.out.println(o);
        System.out.println(Results.fail(ExceptionEnum.JwtCheckException));
    }
    @Test
    public void test3() {
        System.out.println("结果"+jwtUtils.createToken("123456789"));
    }

}
